package org.langqiao.string;
/*
 * 将英语规则名词由单数变为复数,a、e、i、o、u为元音字母
 */
import java.io.*;
public class words {
	
	public static void main(String[] args)throws IOException {
		
		System.out.println("请输入一个单词：");
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String s = br.readLine();
		char[] word = s.toCharArray();//将字符窜转换为字符数组
		int len = word.length;
		StringBuffer sb = new StringBuffer();
		//辅音字母，并且结尾字母是y
		if(len > 1 && word[len-1] == 'y' && !isvowel(word[len-2])) {
			word[len-1]='i';
			for(int i=0;i<len;i++) {
				sb.append(word[i]);
			}
			sb.append('e');
			sb.append('s');
		} else if((word[len-1]=='x')||(word[len-2]=='c'&&word[len-1]=='h')||(word[len-2]=='s'&&word[len-1]=='h')||len>1&&isvowel(word[len-2])&&word[len-1]=='o'){
			for(int i=0;i<len;i++) {
				sb.append(word[i]);
			}
			sb.append('e');
			sb.append('s');
		} else {
			for(int i=0;i<len;i++) {
				sb.append(word[i]);
			}
			sb.append('s');
		}
		String str = new String();
		str = sb.toString();
		System.out.println(str);
	}
	
	public static boolean isvowel(char ch) {
		return ch == 'a' || ch == 'e' || ch == 'i' || ch == '0' || ch == 'u';
	}
}
